<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.12.2.min.js" type="text/javascript"></script>
    <script src="../js/jquery.form.min.js" type="text/javascript"></script>
    <script src="../layui/layui.js"></script>
    <link rel="stylesheet" href="../layui/css/layui.css">

</head>
<body>
<!--上传文件得form表单里面得属性必须是 method="post" enctype="multipart/form-data"-->

<div class="layui-upload">
    <input type="file" class="layui-btn layui-btn-normal" id="test8" name="upfile">
    <button type="button" class="layui-btn" id="test9">开始上传</button>
</div>


</body>
<script>
    layui.use('upload', function() {
        var $ = layui.jquery
            , upload = layui.upload;
        //选完文件后不自动上传
        upload.render({
            elem: '#test8'
            , url: '/hospital/doctor/upload.do' //改成您自己的上传接口
            , auto: false
            //,multiple: true
            , bindAction: '#test9'
            , done: function (res) {
                layer.msg('上传成功');
                console.log(res)
               // window.parent.location.href="index.html"
                window.parent.location.reload();
            }
        });
    })
</script>


</html>